<div class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-2 control-label">建议</label>
        <div class="col-sm-10">
            <input type="text" id="title" name="title" class="form-control"  maxlength="40" placeholder="意见与建议" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">详细描述</label>
        <div class="col-sm-10">
            <input type="text" id="detail" name="detail" class="form-control"  maxlength="40" placeholder="详细描述" />
        </div>
    </div>
    
	<div class="form-group">
	    <div class="col-sm-12 text-center">
	        <button  id="submit" type="button" class="btn btnPrimary" onclick="feeback();" style="width: 288px;height: 42px;">提交</button>
		</div>
	</div>
</div>

<script type="text/javascript">
	function FeebackPageInit()
	{
		EnterKeyListenerForFeeback();
	}
	
	function showFeeback(text){
		$(".feebackModal").fadeIn("slow");
		$("#realName").focus();
	}
	
	function closeFeeback(){
		$(".feebackModal").fadeOut("slow");
	}
	
	//回车键监听函数
	function EnterKeyListenerForFeeback(){
		var event=arguments.callee.caller.arguments[0]||window.event;//消除浏览器差异  
	 	if (event.keyCode == 13){  
	 		feeback();
	 	}  
	}

	//登录按键处理函数
	function feeback(){
		var title = $("#title").val();
		var content = $("#detail").val();
		console.log("feeback title:" + title + " content:" +  content);
    	$.ajax({
             url : "http://dw.gofreeteam.com/DocSystem/Doc/feeback.do",
             type : "post",
             dataType : "json",
             data : {
             	name : title,
                content: content,
             },
             success : function (ret) {
             	if( "ok" == ret.status){
            		bootstrapQ.msg({
    					msg : '提交成功！',
    					type : 'success',
    					time : 1000,
    				});
            		closeFeeback();
            		return;
	            }
                else
                {
            		bootstrapQ.msg({
    					msg : '提交失败:' + ret.msgInfo,
    					type : 'danger',
    					time : 1000,
    				});
            		return false;
                }
            },
            error : function () {
        		bootstrapQ.msg({
					msg : '提交失败:服务器异常',
					type : 'danger',
					time : 1000,
				});
	            return false;
            }
        });
		return true;
    }
</script>
